package com.hnchances.studentscoresystem.service.impl;

import com.hnchances.studentscoresystem.service.BaseService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * 通用 Service 实现类（基础 CRUD）
 * @param <T> 实体类泛型
 * @param <ID> 主键泛型
 * @param <Mapper> Mapper 接口泛型
 */
public abstract class BaseServiceImpl<T, ID, Mapper> implements BaseService<T, ID> {

    @Autowired
    protected Mapper mapper;

    @Override
    public abstract boolean insert(T entity);

    @Override
    public abstract T selectById(ID id);

    @Override
    public abstract List<T> selectAll();

    @Override
    public abstract boolean update(T entity);

    @Override
    public abstract boolean deleteById(ID id);
}